{// 引入标签库 }
<tagLib name="html" />
{// 加载头部公共文件
<include file="Public:headerNew" />
<load href="__PUBLIC__/Js/JqueryUI/jquery-ui-1.8.20.custom.min.js" />
<load href="__PUBLIC__/CSS/JqueryUI/jquery-ui-1.8.20.custom.css" />
<load href="__PUBLIC__/Js/Jquery/jquery.form.js" />
<div id="main" class="main" >
<script type="text/javascript">

        //获取发布模块类型
        function getModuleInfo() {
			var t_url = "{:U('getMeterInfo?bid=')}"+"<php>echo $bid;</php>";
            $.ajax({
                type: "GET",
                dataType: "json",
                url: t_url,
                //data: { id: id, name: name },
                success:function(data, textStatus){
					var json = eval(data['data']);
					$("#myTb tr:not(:first)").remove();
					$('#zoneid').value=0;
					$('#meterid').val('');
					$('#m_price').val('');
                     for (var i in json) {
                        var tbBody = ""
                        var trColor;
                        if (i % 2 == 0) {
                            trColor = "even";
                        }
                        else {
                            trColor = "odd";
                        }
                        tbBody += "<tr class='" + trColor + "'><td><input type=\"checkbox\" name=\"checkbox\" id=\"checkbox\" value="+ json[i].id +" /></td>" + "<td>" + json[i].name + "</td>" + "<td>" + json[i].meterid + "</td>" + "<td>" +json[i].metertype + "</td>"+ "<td>" +json[i].m_price + "</td><td>删除</td></tr>";
                        $("#myTb").append(tbBody);
                    };
                },
                error: function(json) {
                    alert("加载失败");
                }
            });
        }


        $(function() {
            getModuleInfo();
			//check 部分			
			$('body').addClass('has-js');
			$('.label_check,.label_radio').click(function(){ setupLabel(); });
			setupLabel();
			
			
			$('#form1').ajaxForm({
						type: 'POST',
									
						beforeSubmit:  checkForm,  // pre-submit callback
						
						success:       complete,  // post-submit callback
						
						dataType: 'json'
				
				});			        
				function checkForm(){
					

								
							//可以在此添加其它判断
		
						}
							
				function complete(data){
						
							if (data.status==1){
						
										$('#result').html(data.info).show();
						
										// 更新列表
										 getModuleInfo();
									}else{
						
										$('#result').html(data.info).show();
						
									}
			 } 
			
			
			
			
			
			
			
        });
    </script>
<div class="content">
<div class="title">编辑帐号 [ <a href="__URL__">返回列表</a> ]</div>
<form method='post' id='form1' action='__URL__/insertMeterInfo' onsubmit="return false">

   
<table width="900" border="0" >
  <tr>
    <td width="82">选择商网<input name="bizid"  id="bizid" type="hidden" value="<php>echo $bid;</php>" /></td>
    <td width="187"><html:select name="zoneid" id="zoneid"  first="选择区域" options="zonesList" /></td>
    <td width="72">选择表类型</td>
    
    <td width="541">
        <script language="javascript">
    function setupLabel(){ if($('.label_check input').length) { 
		$('.label_check').each(function(){ $(this).removeClass('c_on'); });
		 $('.label_check input:checked').each(function(){ $(this).parent('label').addClass('c_on'); }); }; 
		 if($('.label_radio input').length) { $('.label_radio').each(function(){ $(this).removeClass('r_on'); });
		  $('.label_radio input:checked').each(function(){ $(this).parent('label').addClass('r_on'); }); }; 
	}
   </script>
    
    
    <fieldset class="radios">
    <table width="150" border="0">
  <tr>
    <td width="70"> <label for="radio-01" class="label_radio">
                    <input type="radio" checked="" value="1" id="radio-01" name="tradio" />水表
                </label></td>
    <td width="70"> <label for="radio-02" class="label_radio">
                    <input type="radio" value="2" id="radio-02" name="tradio" />电表
                </label></td>
  </tr>
</table>
 </fieldset>

    
          
       
       
       
     
      </td>
  </tr>
  <tr>
    <td>铭牌信息</td>
    <td>
      <input type="text" name="meterid" id="meterid" class="medium bLeftRequire" /></td>
    <td>单价信息</td>
    <td><input type="text" name="m_price" id="m_price" class="medium bLeftRequire" /></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td><input type="submit" name="metersubmit" id="metersubmit" value="提交" /></td>
  </tr>
</table>
</form>
<div id="divTb">
<table width="900" cellpadding=3 cellspacing=3 id="myTb">
<tr>
  <td width="32" class="tRight" >编号</td>
  <td width="120" class="tLeft" >商网</td>
  <td width="130" class="tLeft" >表编号(铭牌)</td>
  <td width="94" class="tLeft" >类型</td>
  <td width="226" class="tLeft" >单价</td>
  <td width="226" class="tLeft" >操作</td>
</tr>
</table>
 </div>

</div>
</div>
